home *** CD-ROM | disk | FTP | other *** search
- Path: cdc2.cdc.net!sud119
- From: mart@vianet.on.ca (Mart)
- Newsgroups: comp.lang.c,comp.lang.c++,alt.msdos.programmer
- Subject: Clearing the keyboard buffer
- Date: Sun, 21 Jan 96 16:45:10 GMT
- Organization: CDC Internet - 423/842-5709
- Message-ID: <4dtqi4$60u@cdc2.cdc.net>
- NNTP-Posting-Host: sud119.vianet.on.ca
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- I'm using Turbo C++ v. 3.1 and I need to be able to clear the keyboard
- buffer. If there is a function for this, could someone tell me. If there
- isn't a function, then my guess is that I have to make a call to the keyboard
- interrupt, if this is the case, could you post the required interrupt,
- service, and whatever values that have to be sent/read.
-
- BTW, this following bit of code wouldn't work :
-
- while(kbhit())
- {
- getch();
- }
-
- Because I want the user to be able to just keep pushing the same key, making
- the above loop infinitly. If I don't clear the keyboard buffer, my code will
- continue believing that the user is pushing a key, even though their not.
-
- Thanks for any help you can give. Please reply at mart@vianet.on.ca or at
- enigma@cwconnect.ca.
-
- /---------------------\
- | mart@vianet.on.ca |
- | (Enigma Software) |
- | +705-983-5467 |
- \---------------------/
-
- - "If it wasn't for C, we'd be using obol, pasal, basi..."
-